#!/bin/sh -e

TAR=wmmatrix_$1.orig.tar.gz
DIR=wmmatrix-$1.orig

# Download the sources
wget http://dockapps.org/download.php/id/17/wmMatrix-0.2.tar.gz

# POSIX tar archive, remove binaries
tar -x -f wmMatrix-$1.tar.gz
mv wmMatrix-$1 $DIR
GZIP=--best tar -c -z -f $TAR --exclude '*.o' --exclude 'wmMatrix' $DIR
rm -rf $DIR wmMatrix-$1.tar.gz

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
  . .svn/deb-layout
  mv $TAR $origDir
  echo "moved $TAR to $origDir"
fi

exit 0
